
package jweslley.ContestVolumes.VolumeCVII;

import java.util.Scanner;

import jweslley.Problem;
import jweslley.Problem.Status;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/107/10783.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 19/10/2008
 */
@Problem(Status.Accepted)
public class OddSum {

	public static void main(String[] args) {
		StringBuilder out = new StringBuilder();
		Scanner in = new Scanner(System.in);
		int cases = in.nextInt();
		int a0, an, n;
		for (int i = 1; i <= cases; i++) {
			a0 = in.nextInt();
			an = in.nextInt();

			a0 = (a0 % 2 == 0) ? a0 + 1 : a0;
			an = (an % 2 == 0) ? an - 1 : an;
			n = ((an - a0) / 2) + 1;

			out
			.append(String.format("Case %s: %s\n", i, ((a0 + an) * n)/2));
		}
		System.out.print(out);
	}

}
